<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
    <style>
        body {
            background-color: #efefef;
        }
        *{
            padding: 0;
            margin: 0;
        }
        .form {
            position: absolute;
            width: 400px;
            height: 400px;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
            {#background-color: #fff;#}
            padding:10px;
        }
    </style>
</head>
<body>
<div class="form">
    <form class="form-horizontal" action="{% url 'account:register' %}" method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label"></label>
            <div class="col-sm-10">
                <h3 class="text-center"><strong>欢迎注册</strong></h3>
            </div>
        </div>
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">Username</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputEmail3" placeholder="用户名" name="username">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" id="inputPassword3" placeholder="Password" name="password">
            </div>
        </div>
        <div class="form-group">
             <label for="inputPassword3" class="col-sm-2 control-label"></label>
            <div class="col-sm-10">
                <button type="submit" class="col-sm-12 btn btn-info">Register</button>
            </div>
        </div>
        <div class="form-group">
             <label for="inputPassword3" class="col-sm-2 control-label"></label>
            <div class="col-sm-10">
                <a href="{% url 'account:login' %}" class="text-center" style="display: inline-block;">已有账号？立即登录</a>
            </div>
        </div>
    </form>
</div>
</body>
</html>
<script src="{% static 'js/jquery-3.3.1.js' %}"></script>
<script src="{% static 'js/bootstrap.js' %}"></script>
<script>
    {% if messages %}
        {% for message in messages %}
            alert('{{ message }}');
        {% endfor %}
    {% endif %}
</script>
